import Home from './pages/Home'
import About from './pages/About'
import { NavLink, Routes, Route, Navigate } from 'react-router-dom'
function App() {
  return (
    <div>
      <h1>App组件</h1>
      {/* 路由链接 */}
      <NavLink to='/home'>Home</NavLink>
      &nbsp;
      &nbsp;
      <NavLink to='/about'>About</NavLink>
      {/* 注册路由 */}
      <Routes>
        <Route path='/home' element={ <Home/>}></Route>
        <Route path='/about' element={<About />}></Route>
        <Route path='/' element={ <Navigate to='/home'/>}></Route>
      </Routes>
    </div>
  );
}

export default App;
